package com.wbcs.system.function.ifexpression;

import com.wbcs.system.function.IFuncDo;

public class FuncIsOk extends AbsIfFunc {

    public FuncIsOk(String funcName, String lstNameUpChain, String do1, String do2) {
        super(funcName, lstNameUpChain, do1, do2);
    }

    @Override
    public boolean exec(Object ifObj, IFuncDo ido) {
        Boolean isok = (Boolean)ifObj;
        if(isok)
        {//上个链条执行成功
            ido.doSelect();
            return true;
        }
        else
        {//上个链条执行失败
            ido.error(do2);
        }

        return false;
    }

    @Override
    public String funcName() {
        return funcName;
    }
}
